﻿<UserControl x:Uid="UserControl_1" x:Class="Up2dateConsole.ToolBar.ToolBar"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:helpers="clr-namespace:Up2dateConsole.Helpers" 
             xmlns:main="clr-namespace:Up2dateConsole"
             xmlns:local="clr-namespace:Up2dateConsole.ToolBar"
             mc:Ignorable="d" 
             Height="32"
             d:DataContext="{d:DesignInstance local:ToolBarViewModel}">

    <UserControl.Resources>
        <ResourceDictionary x:Uid="ResourceDictionary_1">
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary x:Uid="ResourceDictionary_2" Source="..\Styles.xaml"/>
                <ResourceDictionary x:Uid="ResourceDictionary_3" Source="..\Texts.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <BooleanToVisibilityConverter x:Uid="BooleanToVisibilityConverter_1" x:Key="BooleanToVisibilityConverter"/>
            <helpers:InvertBooleanToVisibilityConverter x:Uid="helpers:InvertBooleanToVisibilityConverter_1" x:Key="InvertBooleanToVisibilityConverter"/>
        </ResourceDictionary>
    </UserControl.Resources>

    <StackPanel x:Uid="StackPanel_1" Orientation="Horizontal">
        <Button x:Uid="Button_5" Width="100" Content="Accept" Command="{Binding AcceptCommand}"
                Style="{StaticResource StandardButton}"
                ToolTip="Accept installation of the selected package. Installation will start automatically soon after acceptance."
                Visibility="{Binding CanAcceptReject, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        <Button x:Uid="Button_4" Width="100" Content="Reject" Command="{Binding RejectCommand}"
                Style="{StaticResource StandardButton}"
                ToolTip="Reject installation of the selected package."
                Visibility="{Binding CanAcceptReject, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        <Button x:Uid="Button_6" Width="100" Content="Delete" Command="{Binding DeleteCommand}"
                Style="{StaticResource StandardButton}"
                ToolTip="Delete selected package."
                Visibility="{Binding CanDelete, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        <StackPanel x:Uid="StackPanel_8" Orientation="Horizontal" VerticalAlignment="Center"
                    Visibility="{Binding IsAdminMode, Converter={StaticResource BooleanToVisibilityConverter}}">
            <Button x:Uid="Button2" Width="100" Content="Install" Command="{Binding InstallCommand}"
                    Style="{StaticResource StandardButton}"
                    ToolTip="Install selected package"
                    Visibility="{Binding CanInstall, Converter={StaticResource BooleanToVisibilityConverter}}"/>
            <Button x:Uid="Button1" 
                    Style="{StaticResource StandardButton}"
                    ToolTip="Request UP2DATE service authorization data (key is provided by the administrator)"
                    Command="{Binding RequestCertificateCommand}">
                <StackPanel x:Uid="StackPanel_2" Orientation="Horizontal">
                    <TextBlock x:Uid="TextBlock_2" Text="{StaticResource KeyIcon}" Foreground="DarkOrange" Style="{StaticResource ButtonIcon}"/>
                    <TextBlock x:Uid="TextBlock1" Margin="5,0,0,0" Text="Authorization..." VerticalAlignment="Center"/>
                </StackPanel>
            </Button>
            <Button x:Uid="Button_3" Command="{Binding SettingsCommand}" ToolTip="View or change settings" Style="{StaticResource StandardButton}">
                <TextBlock x:Uid="TextBlock_7" Text="{StaticResource wrenchIcon}" Style="{StaticResource ButtonIcon}"/>
            </Button>
        </StackPanel>
        <Button x:Uid="Button_1" Command="{Binding RefreshCommand}" ToolTip="Refresh the list of packages" Style="{StaticResource StandardButton}">
            <TextBlock x:Uid="TextBlock_3" Text="{StaticResource RefreshIcon}" Style="{StaticResource ButtonIcon}"/>
        </Button>
    </StackPanel>

</UserControl>
